package edu.zut;

import java.util.Scanner;

class student{
    String name;
    int age;
    String sex;
    int qq;
    long ID;
    public void a1(){
        System.out.println("姓名："+name+"；年龄："+age+"；性别："+sex+"；qq："+qq+"；学号："+ID+"。");

    }
    public void a2(){
        if(age>=18){
            System.out.println("（已成年）");
        }else{
            System.out.println("（未成年）");
        }
    }
    public boolean a3(){
        student aa3 = new student();
        if(qq==31330){
            System.out.println("\t\tqq正确");
        }else{
            System.out.println("学生信息不符，请重新输入：");
            Scanner scan = new Scanner(System.in);
            System.out.println("请输入学生新姓名：");
            aa3.name = scan.next();
            System.out.println("请输入学生新年龄：");
            aa3.age = scan.nextInt();
            System.out.println("请输入学生新性别：");
            aa3.sex = scan.next();
            System.out.println("请输入学生新qq：");
            aa3.qq = scan.nextInt();
            System.out.println("请输入学生新学号：");
            aa3.ID = scan.nextLong();
            System.out.println("姓名："+aa3.name+"；年龄："+aa3.age+"；性别："+aa3.sex+"；qq："+aa3.qq+"；学号："+aa3.ID+"。");
        }
        return false;
    }
    void a4(){
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.qq = qq;
        this.ID = ID;
        if(a3()){
            System.out.println("-----\t已保存\t-----");
        }else{
            System.out.println("以下信息：");
            System.out.println("姓名："+name+"；年龄："+age+"；性别："+sex+"；qq："+qq+"；学号："+ID+"。");
            System.out.println("已保存");
        }
    }
}

class stu{
    String habby;
    int year;
    stu(){
        this.habby = habby;
        this.year = year;
    }
    public void b1(){
        if(year>=2){
            System.out.println("继续坚持你的爱好！");
        }else{
            System.out.println("你的爱好坚持不到两年！");
        }
    }
}

public class class03 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入学生姓名：");
        student name = new student();
        name.name = scan.next();
        System.out.println("请输入学生年龄：");
        name.age = scan.nextInt();
        System.out.println("请输入学生性别：");
        name.sex = scan.next();
        System.out.println("请输入学生qq：");
        name.qq = scan.nextInt();
        System.out.println("请输入学生学号：");
        name.ID = scan.nextInt();
        stu person = new stu();
        System.out.println("请输入你的爱好：");
        person.habby = scan.next();
        System.out.println("请输入爱好的年份：");
        person.year = scan.nextInt();
        name.a1();name.a2();name.a3();name.a4();
        person.b1();
    }
}
